﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 商场收银系统v1._0
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        double total = 0.0d;
        private void btnOK_Click(object sender, EventArgs e)
        {
            double single = Convert.ToDouble(txtPrice.Text) * Convert.ToInt32(txtNum.Text);
            total += single;
            lbxList.Items.Add(string.Format("单价：{0} 数量：{1} 单项累计：{2}",txtPrice.Text,txtNum.Text,single.ToString()));
            totalPrice.Text = total.ToString();
        }

        private void btnReSet_Click(object sender, EventArgs e)
        {
            txtNum.Text = "0";
            txtPrice.Text = "0.0";
        }
    }
}
